package com.ruoyi.hr.controller.hr.salaryquery;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.Ztree;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zeo
 * @explain 薪资查询
 * @date 2020/3/14
 */
@Controller
@RequestMapping("/salaryQuery")
public class SalaryQueryController extends BaseController {

//    @Autowired
//    SalaryAdminService salaryAdminService;


    private String prefix = "hr/salaryquery";

    /**
     * 跳转分页页面
     */
    @GetMapping()
    public String salaryQuery() {
        return prefix + "/salaryQuery";
    }

    /**
     * 欢迎
     */
    @GetMapping("/welcome")
    public String welcome() {
        return prefix + "/welcome";
    }

    /**
     * 加载薪资管理左侧树状
     */
    @GetMapping("/treeData")
    @ResponseBody
    public List<Ztree> treeData() {
        List<Ztree> ztrees = new ArrayList<Ztree>();
        Ztree ztree[] = {
                new Ztree((long) 100, (long) 0, "薪资接口历史", "薪资接口历史"),
                new Ztree((long) 101, (long) 100, "考勤数据历史", "考勤数据历史"),
                new Ztree((long) 102, (long) 100, "应加应扣历史", "应加应扣历史"),

                new Ztree((long) 108, (long) 0, "月薪资历史", "月薪资历史"),
                new Ztree((long) 109, (long) 108, "月薪资历史", "月薪资历史"),
                new Ztree((long) 110, (long) 108, "月薪资历史导入", "月薪资历史导入"),
        };
        for (int i = 0; i < ztree.length; i++) {
            ztrees.add(ztree[i]);
        }
        return ztrees;
    }
}
